<!DOCTYPE html>
<html lang="{{ lang }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{ type_name }} - {{ i18n(key='navigation_products') }} - {{ site_info.name }}</title>
    <link rel="shortcut icon" href="{{ url_for('static', path='favicon.ico') }}" type="image/x-icon">
    <meta name="keywords" content="{{ site_info.keyword }}" />
    <meta name="description" content="{{ site_info.description }}" />
    <meta name="applicable-device" content="pc,mobile" />
	<link href="{{ url_for('static', path='css/bootstrap.min.css') }}" rel="stylesheet" />
	<link href="{{ url_for('static', path='css/bxslider.css') }}" rel="stylesheet" />
	<link href="{{ url_for('static', path='css/style.css') }}" rel="stylesheet" />
	<script src="{{ url_for('static', path='js/jquery.min.js') }}"></script>
	<script src="{{ url_for('static', path='js/bxslider.min.js') }}"></script>
	<script src="{{ url_for('static', path='js/common.js') }}"></script>
	<script src="{{ url_for('static', path='js/bootstrap.min.js') }}"></script>
</head>
<body>
    {% include 'layout/header.html' %}
    <div class="page_bg" style="background: url({{ url_for('static', path='images/detail_bg.jpg') }}) center top no-repeat;"></div>
    <div class="bread_bg">
        <div class="container">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12">
                    <div class="bread_nav">
                        <span class="glyphicon glyphicon-home" aria-hidden="true"></span>
                        <a href="{{ url_for('index') }}">{{ i18n(key='navigation_home') }}</a> >
                        <a href="{{ url_for('all_product_list') }}">{{ i18n(key='navigation_products') }}</a> >
                        {% if not type_id %}
                        <a href="{{ url_for('all_product_list') }}">{{ type_name }}</a>
                        {% else %}
                        <a href="{{ url_for('product_list', id_=type_id) }}">{{ type_name }}</a>
                        {% endif %}
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container">
        <div class="row">
            <!-- left -->
            <div class="col-xs-12 col-sm-4 col-md-3">
                {% include 'layout/product_type_sidebar.html' %}
                {% include 'layout/news_sidebar.html' %}
            </div>
            <!-- right -->
            <div class="col-xs-12 col-sm-8 col-md-9" style="float:right">
                <div class="right_head">
                    <h2><span>{{ type_name }}</span></h2>
                </div>
                <div class="product_list product_list2">
                    {% for product in products %}
                    <div class="col-sm-4 col-md-4 col-mm-6 product_img">
                        <a href="{{ url_for('product', id_=product.id) }}" title="{{ product.name }}">
                            <img src="{{ url_for('upload', path='product/' + (product.id | string) + '.jpg') }}" alt="{{ product.name }}" class="img-thumbnail" />
                        </a>
                        <p class="product_title">
                            <a href="{{ url_for('product', id_=product.id) }}" title="{{ product.name }}">{{ product.name }}</a>
                        </p>
                    </div>
                    {% endfor %}
                    <div class="pages">
                        <ul>
                            {% if pagination.currentPage != 1 %}
                            <a href="{{ url_for('product_list', id_=type_id, page=1) }}"  style="text-decoration: none;">
                                <li><span class="pageinfo pageinfo-link">{{ i18n(key='first_page') }}</span></li>
                            </a>
                            {% endif %}
                            {% if pagination.prevPage %}
                            <a href="{{ url_for('product_list', id_=type_id, page=pagination.prevPage) }}" style="text-decoration: none;">
                                <li><span class="pageinfo pageinfo-link">{{ i18n(key='prev_page') }}</span></li>
                            </a>
                            {% endif %}
                            <li>
                                <span class="pageinfo">
                                    {{ i18n(key='page') }}
                                    <strong>{{ pagination.currentPage }} / {{ pagination.totalPage }}</strong>
                                    {{ i18n(key='total') }}
                                    <strong>{{ pagination.totalRows }}</strong>
                                    {{ i18n(key='records') }}
                                </span>
                            </li>
                            {% if pagination.nextPage %}
                            <a href="{{ url_for('product_list', id_=type_id, page=pagination.nextPage) }}" style="text-decoration: none;">
                                <li><span class="pageinfo pageinfo-link">{{ i18n(key='next_page') }}</span></li>
                            </a>
                            {% endif %}
                            {% if pagination.currentPage != pagination.totalPage %}
                            <a href="{{ url_for('product_list', id_=type_id, page=pagination.totalPage) }}" style="text-decoration: none;">
                                <li><span class="pageinfo pageinfo-link">{{ i18n(key='last_page') }}</span></li>
                            </a>
                            {% endif %}
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {% include 'layout/footer.html' %}
</body>
</html>